const r = {
  aliyun: "https://szqerp.oss-cn-guangzhou.aliyuncs.com",
  "szqerp-prod": "http://api.szqerp.com/erp/static",
  "szqerp-dev": "http://apidev.szqerp.com/erp/static"
};
function i(e, t = location.href) {
  var n = new RegExp("(^|[&,?])" + e + "=([^&]*)(&|$)", "gi").exec(
    t
  ), s;
  return (s = n) ? s[2] : null;
}
function p(e, t = "osstype") {
  return e ? i(t, e) : "";
}
function f(e) {
  return !!/\.(jpg|jpeg|png|GIF|JPG|PNG)/.test(e);
}
function d(e) {
  var t = e && e.lastIndexOf && e.lastIndexOf("/");
  if (t >= 0) {
    var n = e.substr(0, t), s = e.substr(t + 1, e.length), o = s.indexOf("?");
    if (o >= 0) {
      var u = s.substr(0, o), c = s.substr(o + 1, s.length);
      c ? s = `${encodeURIComponent(u)}?${c}` : s = `${encodeURIComponent(u)}`;
    }
    if (s)
      return `${n}/${s}`;
  }
  return e;
}
function v(e, t = !1) {
  var n = e && e.indexOf("http") == 0, s = p(e, "osstype");
  return s || (s = p(e, "ossType")), s || (s = "szqerp-prod"), !n && s && (e = `${r[s]}/${d(e)}`), !t && f(e) && s === "aliyun" && (e += "&x-oss-process=image/resize,h_800,w_800"), t && (e = e.replace("&x-oss-process=image/resize,h_800,w_800", "")), e;
}
const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ossType: r,
  getUrlParam: i,
  getQueryParams: p,
  completeFilePath: v
}, Symbol.toStringTag, { value: "Module" }));
export {
  y as i
};
